{We try to offset the text so it's not overlapping a grid border.}
Offset:=3*DefaultBorderWidth*(GetDeviceCaps(fPrinter.Handle, LOGPIXELSX) div DefaultDPI);
if Canvas.TextWidth(CurToken) < (CurWidth-Offset) then
if CurAlignment = taRightJustify then LeftPos:=LeftPos - Offset
else if CurAlignment = taLeftJustify then LeftPos:=LeftPos + Offset;
{Print out the current token.}
if fPrintingToFile then
System.Write(fFileVar, GenSpace(LeftPos div Canvas.TextWidth(' '))+CurToken+GenSpace((CurWidth-(LeftPos+Canvas.TextWidth(CurToken))) div Canvas.TextWidth(' ') ) )